package com.hinnotek.warehouse.bean

import java.io.Serializable

/**
 * 测试数据
 */
data class ProjectTree(
    val id: Int
) {

    companion object {
        @JvmStatic
        fun getData(): ArrayList<ProjectTree> {
            val data = ArrayList<ProjectTree>()
            data.add(ProjectTree(0))
            data.add(ProjectTree(0))
            data.add(ProjectTree(0))

            return data
        }
    }

}

data class DeviceDetailBean(val name: String, val detail: String?, val visibility: Int = 0) {
    constructor(name: String, detail: String) : this(name, detail, 0)
}

/**
 * 设备使用情况
 */
data class DeviceInfoBean(
    val borrowState: String,
    val createUser: String,
    val createUserId: Int,
    val deleteFlag: Int,
    val deviceId: Int,
    val deviceModel: String,
    val deviceName: String,
    val deviceType: String,
    val deviceTypeName: String,
    val frmlossState: String,
    val inputOutput: String,
    val inputTime: String,
    val installEndTime: String,
    val installId: String,
    val installStartTime: String,
    val installTime: String?,
    val instructionsUrl: String,
    val latitude: String,
    val longitude: String,
    val maintenance: String?,
    val materielNum: String?,
    val outputTime: String,
    val personName: String,
    val productCertificateUrl: String,
    val productMoney: String,
    val productNum: String,
    val productNumUrl: String,
    val productTime: String?,
    val productTimeEnd: String,
    val productTimeStart: String,
    val replaceEndTime: String,
    val replaceFlag: String,
    val replaceStartTime: String,
    val replaceTime: String?,
    val startTime: String,
    val testReportUrl: String,
    val updateTime: Long,
    val updateUser: String,
    val wareId: String
) : Serializable {
    var maintenanceData = ""
        get() {
            return when (maintenance) {//是否是维保期内 00 是  01 否   null默认否
                null -> "否"
                "00" -> "是"
                "01" -> "否"
                else -> "否"
            }
        }

    var inputOutputData = ""
        get() {
            return when (maintenance) {//01已入库，02已出库，03出库完成
                "01" -> "已入库"
                "02" -> "已出库"
                "03" -> "出库完成"
                else -> "已入库"
            }
        }
    var replaceFlagData = ""
        get() {
            return when (replaceFlag) {//01已入库，02已出库，03出库完成
                "00" -> "否"
                "01" -> "是"
                else -> "否"
            }
        }

    var isShowTime = 0
        get() {
            return if (productTime == null)
                0
            else
                1
        }

}